Optimal. Leaf size=85 \[ -\sqrt {a-b} \text {ArcTan}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )-\frac {(3 a-b) \sqrt {a+b \cot ^2(x)} \tan (x)}{3 a}+\frac {1}{3} \sqrt {a+b \cot ^2(x)} \tan ^3(x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.353, Rules used = {3751, 486, 597,
12, 385, 209} \begin {gather*} -\sqrt {a-b} \text {ArcTan}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )+\frac {1}{3} \tan ^3(x) \sqrt {a+b \cot ^2(x)}-\frac {(3 a-b) \tan (x) \sqrt {a+b \cot ^2(x)}}{3 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 209
Rule 385
Rule 486
Rule 597
Rule 3751
Rubi steps
\begin {align*} \int \sqrt {a+b \cot ^2(x)} \tan ^4(x) \, dx &=-\text {Subst}\left (\int \frac {\sqrt {a+b x^2}}{x^4 \left (1+x^2\right )} \, dx,x,\cot (x)\right )\\ &=\frac {1}{3} \sqrt {a+b \cot ^2(x)} \tan ^3(x)-\frac {1}{3} \text {Subst}\left (\int \frac {-3 a+b-2 b x^2}{x^2 \left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\cot (x)\right )\\ &=-\frac {(3 a-b) \sqrt {a+b \cot ^2(x)} \tan (x)}{3 a}+\frac {1}{3} \sqrt {a+b \cot ^2(x)} \tan ^3(x)+\frac {\text {Subst}\left (\int -\frac {3 a (a-b)}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\cot (x)\right )}{3 a}\\ &=-\frac {(3 a-b) \sqrt {a+b \cot ^2(x)} \tan (x)}{3 a}+\frac {1}{3} \sqrt {a+b \cot ^2(x)} \tan ^3(x)+(-a+b) \text {Subst}\left (\int \frac {1}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\cot (x)\right )\\ &=-\frac {(3 a-b) \sqrt {a+b \cot ^2(x)} \tan (x)}{3 a}+\frac {1}{3} \sqrt {a+b \cot ^2(x)} \tan ^3(x)+(-a+b) \text {Subst}\left (\int \frac {1}{1-(-a+b) x^2} \, dx,x,\frac {\cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )\\ &=-\sqrt {a-b} \tan ^{-1}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )-\frac {(3 a-b) \sqrt {a+b \cot ^2(x)} \tan (x)}{3 a}+\frac {1}{3} \sqrt {a+b \cot ^2(x)} \tan ^3(x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in
optimal.
time = 1.68, size = 174, normalized size = 2.05 \begin {gather*} \frac {1}{3} \sqrt {a+b \cot ^2(x)} \left (1+\frac {b \cot ^2(x)}{a}\right ) \sin ^2(x) \left (-\frac {4 (a-b) \cos ^2(x) \left (a+b \cot ^2(x)\right ) \, _2F_1\left (2,2;\frac {3}{2};\frac {(a-b) \cos ^2(x)}{a}\right )}{a^2}+\frac {\left (a-2 b \cot ^2(x)\right ) \csc ^2(x) \left (\text {ArcSin}\left (\sqrt {\frac {(a-b) \cos ^2(x)}{a}}\right ) \sqrt {\frac {(a-b) \cos ^2(x)}{a}}+\sqrt {\frac {b \cos ^2(x)}{a}+\sin ^2(x)}\right )}{\left (a+b \cot ^2(x)\right ) \sqrt {\frac {b \cos ^2(x)}{a}+\sin ^2(x)}}\right ) \tan ^3(x) \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(950\) vs.
\(2(71)=142\).
time = 0.64, size = 951, normalized size = 11.19
method | result | size |
default | \(\text {Expression too large to display}\) | \(951\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.79, size = 239, normalized size = 2.81 \begin {gather*} \left [\frac {3 \, a \sqrt {-a + b} \log \left (-\frac {a^{2} \tan \left (x\right )^{4} - 2 \, {\left (3 \, a^{2} - 4 \, a b\right )} \tan \left (x\right )^{2} + a^{2} - 8 \, a b + 8 \, b^{2} + 4 \, {\left (a \tan \left (x\right )^{3} - {\left (a - 2 \, b\right )} \tan \left (x\right )\right )} \sqrt {-a + b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{\tan \left (x\right )^{4} + 2 \, \tan \left (x\right )^{2} + 1}\right ) + 4 \, {\left (a \tan \left (x\right )^{3} - {\left (3 \, a - b\right )} \tan \left (x\right )\right )} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{12 \, a}, -\frac {3 \, \sqrt {a - b} a \arctan \left (\frac {2 \, \sqrt {a - b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )}{a \tan \left (x\right )^{2} - a + 2 \, b}\right ) - 2 \, {\left (a \tan \left (x\right )^{3} - {\left (3 \, a - b\right )} \tan \left (x\right )\right )} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{6 \, a}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a + b \cot ^{2}{\left (x \right )}} \tan ^{4}{\left (x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 476 vs.
\(2 (71) = 142\).
time = 0.49, size = 476, normalized size = 5.60 \begin {gather*} -\frac {1}{6} \, {\left (3 \, \sqrt {-a + b} \log \left ({\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2}\right ) - \frac {4 \, {\left (3 \, {\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{4} {\left (2 \, a - b\right )} \sqrt {-a + b} - 6 \, {\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2} a^{2} \sqrt {-a + b} + {\left (4 \, a^{3} - a^{2} b\right )} \sqrt {-a + b}\right )}}{{\left ({\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2} - a\right )}^{3}}\right )} \mathrm {sgn}\left (\sin \left (x\right )\right ) + \frac {{\left (3 \, a^{2} \sqrt {-a + b} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) - 9 \, a^{2} \sqrt {b} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) - 15 \, a \sqrt {-a + b} b \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) + 21 \, a b^{\frac {3}{2}} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) + 12 \, \sqrt {-a + b} b^{2} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) - 12 \, b^{\frac {5}{2}} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) + 8 \, a^{2} \sqrt {-a + b} - 18 \, a^{2} \sqrt {b} - 24 \, a \sqrt {-a + b} b + 30 \, a b^{\frac {3}{2}} + 12 \, \sqrt {-a + b} b^{2} - 12 \, b^{\frac {5}{2}}\right )} \mathrm {sgn}\left (\sin \left (x\right )\right )}{6 \, {\left (a^{2} + 3 \, a \sqrt {-a + b} \sqrt {b} - 5 \, a b - 4 \, \sqrt {-a + b} b^{\frac {3}{2}} + 4 \, b^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\mathrm {tan}\left (x\right )}^4\,\sqrt {b\,{\mathrm {cot}\left (x\right )}^2+a} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________